package com.sxs.tools.toastx;

import android.view.View;

/**
 * @Author: sxs
 * @Time: 2020/8/19 20:49
 * @Desc: {@link View.OnClickListener} 包装类
 */
final class ViewClickWrapper implements View.OnClickListener {

    private final XToast mToast;
    private final OnClickListener mListener;

    ViewClickWrapper(XToast toast, View view, OnClickListener listener) {
        mToast = toast;
        mListener = listener;

        view.setOnClickListener(this);
    }

    @SuppressWarnings("unchecked")
    @Override
    public final void onClick(View v) {
        mListener.onClick(mToast, v);
    }
}